import 'package:shared_preferences/shared_preferences.dart';

/// 作者: Tao
/// 日期: 2024/1/17
/// 时间: 14:11
/// 描述: SharedPreferences 本地存储
class LocalStorage {
  /// 存储String
  static save(String key, value) async {
    SharedPreferences sp = await SharedPreferences.getInstance();
    sp.setString(key, value);
  }

  /// 获取
  static get(String key) async {
    SharedPreferences sp = await SharedPreferences.getInstance();
    return sp.get(key);
  }

  ///移除
  static remove(String key) async {
    SharedPreferences sp = await SharedPreferences.getInstance();
    sp.remove(key);
  }
}
